# vi: set ts=8 sw=8 sts=8 noexpandtab:

TARGET_ARCH             := arm
TARGET_SUB_ARCH         := 
CROSS_PREFIX            := 


######################################################

CC                      := $(CROSS_PREFIX)gcc
CPP                     := $(CROSS_PREFIX)gcc -E
AS                      := $(CROSS_PREFIX)as
LD                      := $(CROSS_PREFIX)ld
AR                      := $(CROSS_PREFIX)ar
NM                      := $(CROSS_PREFIX)nm
STRIP                   := $(CROSS_PREFIX)strip
OBJCOPY                 := $(CROSS_PREFIX)objcopy
SIZE                    := $(CROSS_PREFIX)size
CP                      := /bin/cp -f
MKDIR                   := /bin/mkdir
RM                      := /bin/rm -rf
LOSETUP                 := /sbin/losetup
MKFS_EXT3               := /sbin/mkfs.ext3
MOUNT                   := /bin/mount
UMOUNT                  := /bin/umount
QEMU                    := qemu-system-x86_64 -cpu qemu64

INCLUDES                := -I. -I$(TOPDIR)/include
DEFINES                 := -D__ARCH_$(TARGET_ARCH)__ -D__SUB_ARCH_$(TARGET_SUB_ARCH)__ 
DEFINES                 += -DDEBUG

CFLAGS                  := -nostdinc 
CFLAGS                  += -fno-strict-aliasing -fno-common -fno-builtin
CFLAGS                  += -W -Wall -Wstrict-prototypes
CFLAGS                  += -Wno-unused-variable -Wno-unused-function -Wno-unused-label -Wno-unused-parameter
CFLAGS                  += $(INCLUDES)
CFLAGS                  += $(DEFINES)
CFLAGS                  += -fno-stack-protector 

OFLAGS                  := -O binary -R .note -R .comment -S
LDFLAGS                 := -nostdlib -nostartfiles -nodefaultlibs -static -X
LDRELOC                 := -r
LDSCRIPT                := -T $(TOPDIR)/arch/$(TARGET_ARCH)/$(TARGET_SUB_ARCH)/simplios.lds



######################################################

.SUFFIXES : .o .c .S

%.o:%.c
	$(CC) $(CFLAGS) -c $< -o $@

%.o:%.S
	$(CC) $(CFLAGS) -c $< -o $@

######################################################




